# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-cache-lru
_pkgname=Cache-LRU
pkgver=0.04
pkgrel=11
pkgdesc='A simple, fast implementation of LRU cache in pure perl.'
arch=('any')
license=('PerlArtistic')
options=('!emptydirs')
depends=('perl')
makedepends=('perl-module-install')
url='http://search.cpan.org/~kazuho/Cache-LRU-0.04/lib/Cache/LRU.pm'
source=("http://search.cpan.org/CPAN/authors/id/K/KA/KAZUHO/$_pkgname-$pkgver.tar.gz")
sha512sums=('9fd4f56da78e4b8e291c4291ccb2e34bc50f7294fc8ff1d942d21fb116a5613c96f8e55ef9bb95a7ae3e810e791d3edf2f9f15063fd0fb85414a8e8964e88118')

build() {
  cd "$_pkgname-$pkgver"

  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL="--skipdeps" \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
    PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
    MODULEBUILDRC=/dev/null

  perl Makefile.PL
}

package() {
  cd "$_pkgname-$pkgver"

  make DESTDIR="$pkgdir" install
}

